<?php

namespace app\model;

use think\Model;

class Orders extends Model
{
    // 关联 Recyclables 模型
    public function recyclables(){
        return $this->belongsTo(Recyclables::class,'recyclables_id','id');
    }
    // 通过买家id 关联User模型
    public function buyer()
    {
        return $this->belongsTo(User::class, 'reclaim_id', 'id');
    }

    // 通过发布者id 关联User模型
    public function seller()
    {
        return $this->belongsTo(User::class, 'publish_id', 'id');
    }
}